import request from '@/axios'
import { post } from '@/utils/ajax'

// 获取所有字典
export const getDictApi = () => {
  return request.get({ url: '/mock/dict/list' })
}

// 模拟获取某个字典
export const getDictOneApi = async () => {
  return request.get({ url: '/mock/dict/one' })
}

/**
 * 获取汉字对应拼音
 * @param  word 汉字
 * @returns 拼音
 */
export function getPinyin(word: string, tag?: string, sceneName?: string) {
  return post('/code/form/info/getPinyin', { word, tag, sceneName }, { noLoading: true })
}
